package hello;

import java.util.Iterator;
import java.util.Set;

public class HashSet {
    public static void main(String[] args) {
        Set<String> sets = new java.util.HashSet<String>();
        sets.add("String");
        sets.add("name");
        sets.add("name");
        sets.add("Tree");
        sets.add("target");
        String aa = "name";
        System.out.println(sets);
        Iterator<String> it = sets.iterator();
        while (((Iterator) it).hasNext()) {
            String str = it.next();
            if (str.equals(aa)) {
                it.remove();
            }
        }
        System.out.println(sets);
    }
}
